package com.example.demo.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.demo.domain.base.PageParam;
import com.example.demo.domain.base.PageResult;
import com.example.demo.domain.entity.NoticeDO;
import com.example.demo.dao.NoticeMapper;
import com.example.demo.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * NoticeServiceImpl
 *
 * @author haochen78
 * @date 2025/11/7 15:27
 **/
@Service
public class NoticeServiceImpl implements NoticeService {

    @Autowired
    private NoticeMapper noticeMapper;

    @Override
    public PageResult<NoticeDO> list(PageParam param) {
        Page<NoticeDO> pageInfo = noticeMapper.selectPage(new Page<>(param.getPageNum(), param.getPageSize()), null);
        return new PageResult<>(pageInfo);
    }
}
